<template>
	<div class="zuzhiguanli animate__animated animate__fadeIn">
    <div class="flexc" style="margin-bottom: 20px;">
      <div style="width: 100px; text-align: right;">波形类型</div>
      <div>
        <el-select v-model="all.dingyiType" disabled style="width: 350px; margin-left: 30px;" @change="chushihua" clearable filterable placeholder="请选择波形类型">
            <el-option  v-for="item in xialaall.boxingleixing" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;">
      <div style="width: 100px; text-align: right;">信号类型</div>
      <div>
        <el-select v-model="all.xhType" disabled style="width: 350px; margin-left: 30px;"  clearable filterable placeholder="请选择信号类型">
            <el-option  v-for="item in xialaall.xinhaoleixing" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>

    <div class="flexc" style="margin-bottom: 20px;"    v-if="all.dingyiType == 31 || all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">下限频率</div>
      <div>
        <el-select v-model="all.plMin" style="width: 350px; margin-left: 30px;"  disabled clearable filterable placeholder="请选择下限频率">
            <el-option  v-for="item in xialaall.xiaxianpinlv" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;"   v-if="all.dingyiType == 31 || all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">上限频率</div>
      <div>
        <el-select v-model="all.plMax" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择上限频率">
            <el-option  v-for="item in xialaall.shangxianpinlv" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;"  v-if="all.dingyiType == 31">
      <div style="width: 100px; text-align: right;">波形长度</div>
      <div>
        <el-select v-model="all.bxCd" style="width: 350px; margin-left: 30px;" disabled clearable filterable placeholder="请选择波形长度">
            <el-option  v-for="item in xialaall.boxingchangdu" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 32 || all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">谱线数</div>
      <div>
        <el-select v-model="all.pinpu" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择谱线数">
            <el-option  v-for="item in xialaall.puxianshu" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">平均方式</div>
      <div>
        <el-select v-model="all.pjType" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择平均方式">
            <el-option  v-for="item in xialaall.pingjunfangshi" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">平均次数</div>
      <div>
        <el-select v-model="all.pjNum" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择平均次数">
            <el-option  v-for="item in xialaall.pingjuncishu" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">加窗方式</div>
      <div>
        <el-select v-model="all.jcType" style="width: 350px; margin-left: 30px;"  disabled clearable filterable placeholder="请选择加窗方式">
            <el-option  v-for="item in xialaall.jiachuangfangshi" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>
    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 33">
      <div style="width: 100px; text-align: right;">重叠率</div>
      <div>
        <el-select v-model="all.overlay" style="width: 350px; margin-left: 30px;" disabled clearable filterable placeholder="请选择重叠率">
            <el-option  v-for="item in xialaall.chongdielv" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>

    <div class="flexc" style="margin-bottom: 20px;"  v-if="all.dingyiType == 32">
      <div style="width: 100px; text-align: right;">带宽</div>
      <div>
        <el-select v-model="all.dk" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择带宽">
            <el-option  v-for="item in xialaall.kuandai" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>

    <div class="flexc" style="margin-bottom: 20px;" v-if="all.dingyiType == 32">
      <div style="width: 100px; text-align: right;">分析频率</div>
      <div>
        <el-select v-model="all.fxPl" style="width: 350px; margin-left: 30px;" disabled  clearable filterable placeholder="请选择分析频率">
            <el-option  v-for="item in xialaall.fenxipinlv" :key="item.value" :label="item.label" :value="item.value * 1"></el-option>
        </el-select>
      </div>
    </div>

	</div>
</template>

<script>
  import { postxiala,updingyi,downdingyi,removedingyi,updatedingyi,adddingyi,getdiyizu,getdingyizuone } from '@/api/xitong'
  import left2 from '@/view/left2.vue'
	export default {
		name: 'zuzhiguanli',
    components:{
      left2
    },
		data() {
			return {
        all:{
          "dingyiType":"",
          "xhType":"",
          "plMin":"",
          "plMax":"",
          "bxCd":"",
          dingyiName:"",
          dingyiId:"",
          pinpu:"",
          pjType:"",
          jcType:"",
          pjNum:"",
          overlay:"",
          dk:"",
          fxPl:""
        },
        list:[],
        search:{
          page:1,
          page_size:20,
        },
        total:0,

        log:false,
        logtitle:"",

        xialaall:{
          boxingleixing:"",
          xinhaoleixing:"",
          boxingchangdu:"",
          xiaxianpinlv:"",
          shangxianpinlv:"",
          puxianshu:"",
          pingjunfangshi:"",
          pingjuncishu:"",
          jiachuangfangshi:"",
          chongdielv:"",
          kuandai:"",
          fenxipinlv:""
        },

			}
		},
		created() {
      this.getlist()
      this.getxialalist()


      if(this.$store.state.showwho.value){
          this.bianji(this.$store.state.showwho)
      }

		},
		mounted() {

		},
		methods: {
      bianji:function(item){
        getdingyizuone(item.value).then((response)=>{
          this.all = response.data
        })
      },

      chushihua:function(){
        this.all.plMin = ""
        this.all.plMax = ""
        this.all.bxCd = ""
        this.all.pinpu = ""
        this.all.pjType = ""
        this.all.jcType = ""
        this.all.overlay = ""
        this.all.dk = ""
        this.all.fxPl = ""
        this.all.pjNum = ""

        if(this.all.dingyiType == 32){
          this.all.xhType = 1
        }
      },
      logshow:function(){
        this.logtitle = '新增定义组'
        this.all = {
          "dingyiType":"",
          dingyiName:"",
          dingyiId:"",
          "xhType":"",

          "bxCd":"",
          "plMin":"",
          "plMax":"",
          pinpu:"",
          pjType:"",
          pjNum:"",
          jcType:"",
          overlay:"",
          dk:"",
          fxPl:""
        }
        this.log = true
      },



      getlist:function(){

        getdiyizu(this.all).then((response)=>{
          this.list = response.data
        })
      },

      fanye:function(val){
        this.search.page = val
        this.getlist()
      },


      //获取下啦数据用
      getxialalist:function(){
        let obj = {
          sysName:"系统配置",
          dictName:"采集定义组-信号类型",
          dictType:""
        }
        postxiala(obj).then(response => {
          this.xialaall.xinhaoleixing = response.data
        })


        let obj2 = {
          sysName:"系统配置",
          dictName:"采集定义组-波形长度",
          dictType:""
        }
        postxiala(obj2).then(response => {
          this.xialaall.boxingchangdu = response.data
        })


        let obj3 = {
          sysName:"系统配置",
          dictName:"采集定义组-上限频率",
          dictType:""
        }
        postxiala(obj3).then(response => {
          this.xialaall.shangxianpinlv = response.data
        })


        let obj4 = {
          sysName:"系统配置",
          dictName:"采集定义组-下限频率",
          dictType:""
        }
        postxiala(obj4).then(response => {
          this.xialaall.xiaxianpinlv = response.data
        })


        let obj5 = {
          sysName:"系统配置",
          dictName:"采集定义组-波形类型",
          dictType:""
        }
        postxiala(obj5).then(response => {
          this.xialaall.boxingleixing = response.data
        })


        let obj6 = {
          sysName:"系统配置",
          dictName:"采集定义组-谱线数",
          dictType:""
        }
        postxiala(obj6).then(response => {
          this.xialaall.puxianshu = response.data
        })


        let obj7 = {
          sysName:"系统配置",
          dictName:"采集定义组-平均方式",
          dictType:""
        }
        postxiala(obj7).then(response => {
          this.xialaall.pingjunfangshi = response.data
        })


        let obj8 = {
          sysName:"系统配置",
          dictName:"采集定义组-平均次数",
          dictType:""
        }
        postxiala(obj8).then(response => {
          this.xialaall.pingjuncishu = response.data
        })

        let obj9 = {
          sysName:"系统配置",
          dictName:"采集定义组-加窗方式",
          dictType:""
        }
        postxiala(obj9).then(response => {
          this.xialaall.jiachuangfangshi = response.data
        })

        let obj10 = {
          sysName:"系统配置",
          dictName:"采集定义组-重叠率",
          dictType:""
        }
        postxiala(obj10).then(response => {
          this.xialaall.chongdielv = response.data
        })


        let obj11 = {
          sysName:"系统配置",
          dictName:"采集定义组-带宽",
          dictType:""
        }
        postxiala(obj11).then(response => {
          this.xialaall.kuandai = response.data
        })


        let obj12 = {
          sysName:"系统配置",
          dictName:"采集定义组-分析频率",
          dictType:""
        }
        postxiala(obj12).then(response => {
          this.xialaall.fenxipinlv = response.data
        })
      },
		}
	}
</script>


<style scoped >

</style>
